<?php 
require_once("../connect_db.php");
$sql4="select * from costlearn,car,teacher
where costlearn.car_id=car.car_id and cost_date>='".$_GET["start"]."' and cost_date<='".$_GET["stop"]."' ";
$query4=mysql_query($sql4);
?>
<button class="btn btn-success" onClick="Javascript:$('.split2').hide();$('.split1').show();">&#8592;ย้อนกลับ</button>
<div style="margin-top:20px;">

</div>
<form method="post" enctype="multipart/form-data" name="frmreg" id="frmreg">

<div class="row">
	<div class="col-md-12">
		<div class="panel">
		 
		  <div class="panel-body">
		
		  
			<table cellpadding="0" cellspacing="0" border="0" class="display" id="Teacher2" width="100%" style="font-size:14px">
	<thead>
		<tr>
				<th style="width:17%;text-align: center !important;color:black; !important;font-size:1em">เลขที่บิล</th>
			<th style="width:15%;text-align: center !important;color:black; !important;font-size:1em">วันที่เติม</th>
			<th style="width:10%;text-align: center !important;color:black; !important;font-size:1em">ผู้สอน</th>
			<th style="width:10%;text-align: center !important;color:black; !important;font-size:1em">รถที่เติม</th>
			<th style="width:13%;text-align: center !important;color:black; !important;font-size:1em">จำนวนลิตร</th>
			<th style="width:13%;text-align: center !important;color:black; !important;font-size:1em">ราคา/ลิตร</th>
			<th style="width:10%;text-align: center !important;color:black; !important;font-size:1em">จำนวนเงิน</th>
		</tr>
	</thead>

	<tbody style="color:black !important;">
	
		<?php 
		$sums=0;
		while($result4=mysql_fetch_array($query4)){
		$sums+=$result4["cost_price"];
		?>
		<tr>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result4["cost_No"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result4["cost_date"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result4["teach_name"]." ".$result4["teach_lname"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result4["car_brand"].'-'.$result4["car_model"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result4["cost_per"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result4["cost_lit"]?></td>
			<td style="text-align: center !important;color:black; !important;font-size:1em"><?php echo $result4["cost_price"]?></td>
		</tr>
		<?php }?>
	</tbody>
		<tfoot>
		<tr>
				<th colspan="6" style="width:90%;text-align: left !important;color:black; !important;font-size:1em">รวมเป็นเงิน</th>
			
			<th style="width:10%;text-align: right !important;color:black; !important;font-size:1em"><?php echo $sums;?></th>
		</tr>
	</tfoot>
</table>
		  </div>
		</div>
	</div>
</div>
</div>


</form>
<script>


$(document).ready(function(){
var oTable2;
  	oTable2 = $('#Teacher2').dataTable({
          "bJQueryUI": true,
          "sPaginationType": "full_numbers"
      });

 
});
	 
</script>
